package com.gourd.common.controller;

import com.gourd.common.data.BaseResponse;
import com.gourd.common.dic.service.DicService;
import com.gourd.common.dic.vo.DicVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 数据字典明细表 控制器
 * @author gourd
 * @since 2019-07-30
 */
@RestController
@Api(tags = "dic", description = "数据字典控制器" )
@RequestMapping("/dic" )
public class DicController {

    @Autowired
    private DicService dicService;

    /**
     * 获取树形基本行政单位
     * @return
     */
    @GetMapping("/findRegionTree")
    @ApiOperation(value = "获取树形基本行政单位")
    public BaseResponse<List<DicVO>> findRegionTree(@RequestParam Boolean needCountry) {
        return BaseResponse.ok( dicService.findRegionTree(needCountry));
    }

}
